import { store } from "@mall/api-services"
import { useEffect, useState } from "react"

export function useCollections(storeId: string) {
  const [collections, setCollections] = useState([] as store.CustomCollection[])
  useEffect(() => {
    store.CollectionServiceV1.getCollections(storeId).then(setCollections)
  }, [storeId])

  return [collections]
}
